home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 6: Level 6 / 17 Bit - Level 6 (1998)(Epic Marketing)[!].iso / quartz / q1082.dms / q1082.adf / src.lzh / Fig / cursor.c < prev    next >
C/C++ Source or Header  |  1991-07-18  |  5KB  |  129 lines

  1. /* 
  2.  *    FIG : Facility for Interactive Generation of figures
  3.  *
  4.  *    Copyright (c) 1985 by Supoj Sutanthavibul (supoj@sally.UTEXAS.EDU)
  5.  *    January 1985.
  6.  *    1st revision : Aug 1985.
  7.  *
  8.  *    %W%    %G%
  9. */
  10. #include "fig.h"
  11. #include "resources.h"
  12. #include "paintop.h"
  13.  
  14. static u_int    arrow_cursor_array[8]  =  {
  15.         0xC000E000, 0xF000F800, 0xFC00F000, 0x90001800,
  16.         0x18000C00, 0x0C000600, 0x06000300, 0x03000100 };
  17. mpr_static(arrow_cursor_pr, 16, 16, 1, arrow_cursor_array);
  18. CURSORREC    arrow_cursor  =  { 0, 0, MERGE, &arrow_cursor_pr };
  19.  
  20. static short    bull_cursor_array[16] = {
  21.     0x0F00,0x30C0,0x4020,0x4020,0x8010,0x8610,0x8610,0x8010,
  22.     0x4020,0x4020,0x30C0,0x0F00,0x0000,0x0000,0x0000,0x0000
  23.     };
  24. mpr_static(bull_cursor_pr, 16, 16, 1, bull_cursor_array);
  25. CURSORREC    bull_cursor  =  { 5, 5, INV_PAINT, &bull_cursor_pr };
  26.  
  27. static u_int    buster_cursor_array[8] = {
  28.         0x0FE01010, 0x20085004, 0x88028402, 0x82028102,
  29.         0x80828042, 0x80224014, 0x20081010, 0x0FE00000, };
  30. mpr_static(buster_cursor_pr, 16, 16, 1, buster_cursor_array);
  31. CURSORREC    buster_cursor  =  { 7, 7, MERGE, &buster_cursor_pr };
  32.  
  33. static short    char_cursor_data[16] = {
  34.         0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00,
  35.         0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00,
  36.         };
  37. mpr_static(char_cursor_pr, 16, 16, 1, char_cursor_data);
  38. CURSORREC    char_cursor  =  { 0, 13, INV_PAINT, &char_cursor_pr };
  39.  
  40. static short    crosshair_cursor_data[16] = {
  41.         0x1000, 0x1000, 0x1000, 0xFE00, 0x1000, 0x1000, 0x1000, 0x0000,
  42.         0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  43.         };
  44. mpr_static(crosshair_cursor_pr, 16, 16, 1, crosshair_cursor_data);
  45. CURSORREC    crosshair_cursor  =  { 3, 3, INV_PAINT, &crosshair_cursor_pr };
  46.  
  47. CURSORREC    null_cursor  =  { 0, 0, MERGE, 0 };
  48.  
  49. static short    magnifier_cursor_array[16] = {
  50.         0x0F80, 0x3060, 0x4010, 0x4010, 0x8008, 0x8008, 0x8008, 0x8008,
  51.         0x8008, 0x4010, 0x4010, 0x3078, 0x0F9C, 0x000E, 0x0007, 0x0003,
  52.         };
  53. mpr_static(magnifier_cursor_pr, 16, 16, 1, magnifier_cursor_array);
  54. CURSORREC    magnifier_cursor  =  { 6, 6, MERGE, &magnifier_cursor_pr };
  55.  
  56. static short    pencil_cursor_array[16] = {
  57.         0x0000, 0x0018, 0x0024, 0x0075, 0x009B, 0x0117, 0x022E, 0x045C,
  58.         0x08B8, 0x1170, 0x22E0, 0x25C0, 0x7B80, 0x6700, 0x8600, 0x0800,
  59.         };
  60. mpr_static(pencil_cursor_pr, 16, 16, 1, pencil_cursor_array);
  61. CURSORREC    pencil_cursor  =  { 0, 14, MERGE, &pencil_cursor_pr };
  62.  
  63. static u_int    pick15_cursor_array[8] = {
  64.         0x0FE01010, 0x20084004, 0x80028002, 0x80028002,
  65.         0x80028002, 0x80024004, 0x20081010, 0x0FE00000, };
  66. mpr_static(pick15_cursor_pr, 16, 16, 1, pick15_cursor_array);
  67. CURSORREC    pick15_cursor  =  { 7, 7, MERGE, &pick15_cursor_pr };
  68.  
  69. static short    pick9_cursor_array[16] = {
  70.         0x3E00, 0x4100, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x4100,
  71.         0x3E00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  72.         };
  73. mpr_static(pick9_cursor_pr, 16, 16, 1, pick9_cursor_array);
  74. CURSORREC    pick9_cursor  =  { 4, 4, MERGE, &pick9_cursor_pr };
  75.  
  76. static short    vbar_cursor_array[16] = {
  77.         0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
  78.         0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
  79.         };
  80. mpr_static(vbar_cursor_pr, 16, 16, 1, vbar_cursor_array);
  81. CURSORREC    vbar_cursor  =  { 0, 13, INV_PAINT, &vbar_cursor_pr };
  82.  
  83. static u_int    wait_cursor_array[8] = {
  84.         0xFFE04040, 0x40403F80, 0x3F801F00, 0x0E000400,
  85.         0x0A001100, 0x20802080, 0x40404040, 0xFFE00000, };
  86. mpr_static(wait_cursor_pr, 16, 16, 1, wait_cursor_array);
  87. CURSORREC    wait_cursor = { 7, 5, MERGE, &wait_cursor_pr };
  88.  
  89. CURSOR        cur_cursor = &arrow_cursor; /* current cursor */
  90.  
  91. #ifdef    X11
  92. init_cursor()
  93. {
  94.     register Display    *d = tool_d;
  95.  
  96.     arrow_cursor.bitmap = (XImage *)XCreateFontCursor(d, XC_left_ptr);
  97.     bull_cursor.bitmap = (XImage *)XCreateFontCursor(d, XC_circle);
  98.     buster_cursor.bitmap = (XImage *)XCreateFontCursor(d, XC_pirate);
  99.     char_cursor.bitmap = (XImage *)XCreateFontCursor(d, XC_question_arrow);
  100.     crosshair_cursor.bitmap = (XImage *)XCreateFontCursor(d, XC_crosshair);
  101.     null_cursor.bitmap = (XImage *)XCreateFontCursor(d, XC_tcross);
  102.     magnifier_cursor.bitmap = (XImage *)XCreateFontCursor(d, XC_question_arrow);
  103.     pencil_cursor.bitmap = (XImage *)XCreateFontCursor(d, XC_pencil);
  104.     pick15_cursor.bitmap = (XImage *)XCreateFontCursor(d, XC_dotbox);
  105.     pick9_cursor.bitmap = (XImage *)XCreateFontCursor(d, XC_hand1);
  106.     vbar_cursor.bitmap = (XImage *)XCreateFontCursor(d, XC_xterm);
  107.     wait_cursor.bitmap = (XImage *)XCreateFontCursor(d, XC_watch);
  108. }
  109. recolor_cursors()
  110. {
  111.     register Display  *d = tool_d;
  112.     
  113.     XRecolorCursor(d, (Cursor)arrow_cursor.bitmap, &x_fg_color, &x_bg_color);
  114.     XRecolorCursor(d, (Cursor)bull_cursor.bitmap, &x_fg_color, &x_bg_color);
  115.     XRecolorCursor(d, (Cursor)buster_cursor.bitmap, &x_fg_color, &x_bg_color);
  116.     XRecolorCursor(d, (Cursor)char_cursor.bitmap, &x_fg_color, &x_bg_color);
  117.     XRecolorCursor(d, (Cursor)crosshair_cursor.bitmap, &x_fg_color,
  118.                &x_bg_color);
  119.     XRecolorCursor(d, (Cursor)null_cursor.bitmap, &x_fg_color, &x_bg_color);
  120.     XRecolorCursor(d, (Cursor)magnifier_cursor.bitmap, &x_fg_color,
  121.                &x_bg_color);
  122.     XRecolorCursor(d, (Cursor)pencil_cursor.bitmap, &x_fg_color, &x_bg_color);
  123.     XRecolorCursor(d, (Cursor)pick15_cursor.bitmap, &x_fg_color, &x_bg_color);
  124.     XRecolorCursor(d, (Cursor)pick9_cursor.bitmap, &x_fg_color, &x_bg_color);
  125.     XRecolorCursor(d, (Cursor)vbar_cursor.bitmap, &x_fg_color, &x_bg_color);
  126.     XRecolorCursor(d, (Cursor)wait_cursor.bitmap, &x_fg_color, &x_bg_color);
  127. }
  128. #endif    X11
  129.